▍ humdrum codex / soft
2.0 KB raw
id
TASK-002
title
TUI Foofaraw page: editorial pipeline + weekly schedule
status
To Do
assignee
created_date
2026-06-11 02:09
updated_date
2026-06-11 02:13
labels
feature
dependencies
priority
medium
ordinal
2000

Description

New page (key '5') in tui/dashboard.py showing the full Foofaraw/QB editorial pipeline status and the week's publishing schedule.

DATA SOURCE: All stats come from direct httpx REST queries to The Pile's Supabase DB (same creds as pile-admin/pile-reader).

Stat panels:

  1. Open submissions — submissions WHERE submittable_status NOT IN ('accepted','completed','declined')
  2. Needs contract — acceptances WHERE status = 'Accepted'
  3. Contract sent, awaiting return — acceptances WHERE status = 'Contract Sent' AND contract_returned_at IS NULL
  4. Ready to pay — acceptances WHERE status = 'Contract Sent' AND contract_returned_at IS NOT NULL AND payout_batch_id IS NULL

Note: stat 4 is only as fresh as the last pile-contracts run (which stamps contract_returned_at), but the data lives in the DB — no subprocess needed to read it.

Weekly schedule: acceptances WHERE publish_date BETWEEN today AND today+7. Group by project_settings.template: 'standard' → Foofaraw, 'qb' → QB. Show date + author + title per row. Bold today/tomorrow.

Navigation: j/k + Enter. Enter on stat panel shows underlying item list. Enter on schedule item shows detail (author, word_count, status, notes, story_url).

Reference: ~/Developer/The-Pile/scripts/contracts-inbox.js (Supabase client + query patterns), ~/Developer/The-Pile/database/acceptances.sql, migrations/013_contracts_inbox.sql (contract_returned_at), migrations/009_payout_tracking.sql (payout_batch_id).

Acceptance Criteria